use serde::{Deserialize, Serialize};
use derivative::Derivative;

#[rbatis::crud_table(table_name:"dictword")]
#[derive(Serialize, Deserialize, Clone, Derivative, Debug)]
#[derivative(Default)]
pub struct WordDBO {
  pub id: String,
  
  pub word: String,
  pub lang: String,
  pub definitions: Option<String>,
  pub tags: Option<String>,
  
  pub en_exchanges: Option<String>,
  pub en_phonetic: Option<String>,
  pub en_pos: Option<String>,
  pub en_collins: Option<String>,
  pub en_oxford: Option<String>,
  pub en_bnc: Option<String>,
  pub en_frq: Option<String>,

  pub zh_pinyin: Option<String>,
  pub zh_strokes: Option<String>,

  pub created_at: Option<i64>,
  pub updated_at: Option<i64>,
}


#[rbatis::crud_table(table_name:"dictword_trans")]
#[derive(Serialize, Deserialize, Clone, Derivative, Debug)]
#[derivative(Default)]
/// Table Word Translation 
pub struct WordTransDBO {
  /// FK , Word Id
  pub id: String,

  /// Target Language
  pub tlang: String,

  /// 单词翻译释义  
  pub tvalue: Option<String>,

  pub created_at: Option<i64>,
  pub updated_at: Option<i64>,
}


#[rbatis::crud_table(table_name:"dictsentence")]
#[derive(Serialize, Deserialize, Clone, Derivative, Debug)]
#[derivative(Default)]
/// Table Word Translation 
pub struct SentenceDBO {
  /// PK , sentence Id
  pub id: String,

  /// sentence Language
  pub lang: String,

  /// 句子内容  
  pub value: Option<String>,

  pub created_at: Option<i64>,
  pub updated_at: Option<i64>,
}


#[rbatis::crud_table(table_name:"dictsentence_trans")]
#[derive(Serialize, Deserialize, Clone, Derivative, Debug)]
#[derivative(Default)]
/// Table Word Translation 
pub struct SentenceTransDBO {
  /// FK , sentence Id
  pub id: String,

  /// sentence translation Language
  pub tlang: String,

  /// 句子翻译内容  
  pub tvalue: Option<String>,

  pub created_at: Option<i64>,
  pub updated_at: Option<i64>,
}



#[rbatis::crud_table(table_name:"dictword")]
pub struct NewWord {
  pub id: String,
  pub email: String,
  pub wordenname: String,
  pub cred: String,
}


#[rbatis::crud_table(table_name:"dictword_trans")]
pub struct NewWordTrans {
  pub id: String,
  pub email: String,
  pub wordenname: String,
  pub cred: String,
}


#[rbatis::crud_table(table_name:"dictsentence")]
pub struct NewSentence {
  pub id: String,
  pub email: String,
  pub wordenname: String,
  pub cred: String,
}


#[rbatis::crud_table(table_name:"dictsentence_trans")]
pub struct NewSentenceTrans {
  pub id: String,
  pub email: String,
  pub wordenname: String,
  pub cred: String,
}


